package com.restfinder.comment.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

import com.restfinder.model.IEntity;
import com.restfinder.news.model.News;
import com.restfinder.user.model.User;

@Entity
@Table(name="comments")
public class Comment implements IEntity {

	private static final long serialVersionUID = 1L;
	
	@Getter @Setter
	private long id;
	@Getter @Setter
	private Date date;
	@Getter @Setter
	private String content;
	@Getter @Setter
	private User user;
	@ManyToOne(fetch=FetchType.LAZY, targetEntity=News.class)
	@JoinColumn(name="news_id")
	@Getter @Setter
	private News news;
}
